import request from '@/utils/request'


// 扫码
export function scanCode(code, sameBatch) {
  return request({
    url: '/purchase/receive/scan',
    method: 'post',
    params: { code, sameBatch }
  })
}

// 更新拒收状态
export function updateRejectStatus(detailId, isRejected) {
  return request({
    url: '/purchase/receive/reject/' + detailId,
    method: 'put',
    params: { isRejected }
  })
}
// 查询收料通知单列表
export function listReceive(query) {
  return request({
    url: '/purchase/receive/list',
    method: 'get',
    params: query
  })
}

// 查询收料通知单详细
export function getReceive(id) {
  return request({
    url: '/purchase/receive/' + id,
    method: 'get'
  })
}

// 新增收料通知单
export function addReceive(data) {
  return request({
    url: '/purchase/receive',
    method: 'post',
    data: data
  })
}

// 修改收料通知单
export function updateReceive(data) {
  return request({
    url: '/purchase/receive',
    method: 'put',
    data: data
  })
}

// 删除收料通知单
export function delReceive(id) {
  return request({
    url: '/purchase/receive/' + id,
    method: 'delete'
  })
}
